cmake_minimum_required(VERSION 3.0)
project(Rpp_test)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../cmake)
set(ROCM_PATH /opt/rocm CACHE PATH "default ROCm installation path")
find_package(OpenCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(AMDRPP QUIET)

if(NOT OpenCL_FOUND)
	message("-- ${Yellow}Rpp_test requires OpenCL, Found ${OpenCL_INCLUDE_DIRS} ${OpenCL_LIBRARIES} ${ColourReset}")
endif()

if (OpenCL_FOUND)
    include_directories(${OpenCL_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS}/Headers)
    include_directories(${OpenCV_INCLUDE_DIRS})
    include_directories(${ROCM_PATH}/include ${ROCM_PATH}/rpp/include /usr/local/include)
    link_directories(${ROCM_PATH}/lib ${ROCM_PATH}/rpp/lib/ /usr/local/lib)

    add_executable(BatchPD_host_pkd3 BatchPD_host_pkd3.cpp)
    add_executable(BatchPD_host_pln1 BatchPD_host_pln1.cpp)
    add_executable(BatchPD_host_pln3 BatchPD_host_pln3.cpp)
    # add_executable(Single_host Single_host.cpp)
    add_executable(uniqueFunctionalities_host uniqueFunctionalities_host.cpp)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -DOCL_COMPILE=1 -DRPP_BACKEND_OPENCL=1 -std=c++11")
    target_link_libraries(BatchPD_host_pkd3 ${OpenCV_LIBS} -lamd_rpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system)
    target_link_libraries(BatchPD_host_pln1 ${OpenCV_LIBS} -lamd_rpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system)
    target_link_libraries(BatchPD_host_pln3 ${OpenCV_LIBS} -lamd_rpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system)
    # target_link_libraries(Single_host ${OpenCV_LIBS} -lamd_rpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system )
    target_link_libraries(uniqueFunctionalities_host ${OpenCV_LIBS} -lamd_rpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system)
endif()